//
//  TxtHandler.m
//  gdemm
//
//  Created by 乔明超 on 16/4/27.
//  Copyright © 2016年 Goldencis. All rights reserved.
//

#import "TxtHandler.h"
#import "TxtFileController.h"
@implementation TxtHandler
- (BOOL)isSupportedType:(NSString *)suffix{
   
    return  [suffix caseInsensitiveCompare:@"txt"]  == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"cpp"]  == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"h"]    == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"c"]    == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"hpp"]  == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"cxx"]  == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"cs"]   == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"js"]   == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"py"]   == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"lua"]  == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"java"] == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"xml"] == NSOrderedSame  ||
            [suffix caseInsensitiveCompare:@"m"]    == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"mm"]    == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"css"]   == NSOrderedSame ||
            [suffix caseInsensitiveCompare:@"json"] == NSOrderedSame;
    
    
}
- (UIViewController *)getControllerForFilePath:(NSString *)filePath{
    NSString *path = [self getDecryptedPath:filePath];
    if (path == nil) {
        return nil;
    }
    TxtFileController  *txtVc = [[TxtFileController alloc]init];
    txtVc.path = path;
    return txtVc;
}
- (NSString *)getIconWithFileName:(NSString *)fileName enced:(BOOL)isEnced{
    NSString *icon;
    icon = isEnced ? @"cloudDisk_icon_txt_enced" : @"cloudDisk_icon_txt";
    return icon;
}
@end
